package cn.forward.fallback;


import cn.forward.feign.AppFeignClient;
import cn.forward.param.AppLoginParam;
import cn.forward.result.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AppFeignClientFallbackFactory implements FallbackFactory<AppFeignClient> {

    @Override
    public AppFeignClient create(Throwable cause) {
        cause.printStackTrace();
        return new AppFeignClient() {
            @Override
            public R<Void> sava(AppLoginParam appLoginParam) {
                return R.error();
            }
        };
    }
}
